/*-
 * $Id: ExtensionFilter.java 2 2011-11-16 14:11:52Z andrewbass@gmail.com $
 */
package com.google.code.synctimestamps.io.predicates;

import java.io.File;

import com.google.common.base.Predicate;

/**
 * @author Andrew ``Bass'' Shcheglov (andrewbass@gmail.com)
 * @author $Author: andrewbass@gmail.com $
 * @version $Revision: 2 $, $Date: 2011-11-16 14:11:52 +0000 (Wed, 16 Nov 2011) $
 */
public abstract class ExtensionFilter implements Predicate<File> {
	/**
	 * @param input
	 */
	protected static String getExtension(final File input) {
		final String name = input.getName();
		final int index = name.lastIndexOf('.');
		return index == -1 ? null : name.substring(index + 1).toLowerCase();
	}
}
